I created some dice tech for a dice game I worked on. The task was to create a solution that would allow us to predictably roll dice, but also using dynamic dice assets. I wrote a C# solution that we used at runtime, when provided with a set of 6 source 'side' textures, my tool would create a new texture and map it to the existing die asset. Secondly, I created a fairly complex animation tree using the MecAnim state controller system. By breaking up different roll animations into MecAnim Layers (vertical bounce, side turning, spinning, etc.) I was able to create a system which took one integer parameter, and it would properly roll the dice. The video below is an early stage test, eventually (not shown) I created some randomly timed bounce animations, which I then selected randomly using MecAnims State Behaviours, this gave amuch more random and realistic look.


video in html5 by EasyHtml5Video.com v3.9.1